package vendas.dto;

import gminet.infra.dao.TransferObject;
import gminet.infra.toolkit.StringToolkit;

public class Seller extends TransferObject {

    private static final long serialVersionUID = -5407362779569466175L;

    private String name;
    private SellerType type;
    private String webUserName;
    private String coments;
    private ActiveStatus activeStatus;

    public Seller() {
        super();
    }

    public Seller(int id) {
        this();
        setId(id);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public SellerType getType() {
        if (this.type == null) {
            this.type = SellerType.UNDEFINED;
        }
        return type;
    }

    public void setType(SellerType type) {
        this.type = type;
    }

    public String getWebUserName() {
        return webUserName;
    }

    public void setWebUserName(String internetUserName) {
        this.webUserName = internetUserName;
    }

    public String getComents() {
        return coments;
    }

    public String getResumeComents() {
        String resumeComents = "";
        if (getHasComents()) {
            if (getComents().length() <= 58) {
                resumeComents = coments;
            } else {
                resumeComents = coments.substring(0, 55) + "...";
            }
        }
        return resumeComents;
    }

    public void setComents(String coments) {
        this.coments = coments;
    }

    public boolean getHasComents() {
        return StringToolkit.isFill(getComents());
    }
    
    public ActiveStatus getActiveStatus() {
        return activeStatus;
    }
    
    public void setActiveStatus(ActiveStatus activeStatus) {
        this.activeStatus = activeStatus;
    }

}
